package com.game.doudizhu.core;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AITrainerStarter {
    private static final Logger logger = LoggerFactory.getLogger(AITrainerStarter.class);

    public static void main(String[] args) {
        logger.info("开始AI训练...");
        // 开始训练
        while (true) {
            try {
                AITrainer.startTraining();
                // 每轮训练后休息一段时间
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                break;
            } catch (Exception e) {
                logger.error("训练过程出错: ", e);
                // 出错后短暂休息后继续
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException ie) {
                    Thread.currentThread().interrupt();
                    break;
                }
            }
        }
    }
}
